package hd.day924;

/**
 * @author oldliu
 * @since 1.0
 */
public class SbTest {
    public static void main(String[] args) {
        //>>>System.nanoTime();
        //StringBuffer
        StringBuilder sb=new StringBuilder();
        sb.append("后黎元").append("良心").append("还在");
        sb.append("nihao");
        sb.append(2>1);
        sb.append(Math.PI);
        sb.append(Math.pow(3,5));
        sb.append(24.677F);
        sb.append('金');
        System.out.println(sb);
        sb.insert(4,"老刘");
        sb.delete(7,11);
        System.out.println(sb);//大量拼接字符串时使用StringBuilder

        sb.reverse();
        System.out.println(sb);
        String str=sb.toString();
        System.out.println(str);
        System.out.println(Math.random());//[0-1)的小数
        //0.0003
        System.out.println((int)(Math.random()*9000)+1000);//[1000-10000)的小数
    }
}
